﻿using farming.Utility;
using Jose;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace farming.Utility
{
    public static class DecodeJwt
    {
        // 用于解码token 用到jose-jwt包
        public static string Decode(this string Token, string Key)
        {
            string token = Jose.JWT.Decode(
                Token,
                Encoding.UTF8.GetBytes(Key),
                JweAlgorithm.PBES2_HS256_A128KW,
                JweEncryption.A128CBC_HS256,		// 加密算法
                null
            );
            return token;
        }
    }
}
